{extend name="template/base" /}
{block name="style"}
<style>
  .user{clear:both;width:70%;border-bottom:1px #ccc solid;overflow:hidden;line-height:60px;margin:0 auto;}
  .userinfo{float:left;width:300px;}
  .userinfo p{display:inline-block;}
  .userinfo span{}
  .fl{float:left;}
  .imgBox{width:70%;margin:0 auto;padding:30px 0;clear:both;}
  .imgs{text-align:center;font-size:14px;color:#555;width:200px;box-shadow:0 0 10px -2px #ccc;float:left; margin: 0 30px 40px 0;position:relative;}
  .imgs img{
    width:200px;
    height:200px;
  }
  .imgs p{line-height:30px; margin:0;}
</style>
{/block}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
      <div class="user">
        <div class="userinfo">
             <p class=" ">用户：</p>
             <span>
              {$vo['realname']}  {$user['account']}
             </span>
        </div>
       <div class="userinfo">
            <p class="">民族：</p>
            <span class="">
                {$vo.nationality ?? ''}
            </span>
        </div>
        <div class="userinfo">
            <p class="">家乡：</p>
            <span class="">
                {$vo.hometown ?? ''}
            </span>
        </div>
      </div>
    <div class="user">
      <div class="userinfo">
            <p>生日：</p>
            <span>
                {$vo.birthday ?? ''}
              </span>
        </div>
      <div class="userinfo">
            <p>居住：</p>
            <span>
                {$vo.domicile ?? ''}
              </span>
        </div>
      <div class="userinfo">
            <p>标签：</p>
            <span>
                {$vo.tag ?? ''}
              </span>
        </div>
    </div>
       <div class="user">
      <div class="userinfo">
            <p>身份证：</p>
            <span>
                {$vo.id_card ?? ''}
              </span>
        </div>
      <div class="userinfo">
            <p>微信号：</p>
            <span>
                 {$vo.weixin_no ?? ''}
              </span>
        </div>
    </div>
       <div class="user">
      <div class="userinfo">
            <p>车类型：</p>
            <span>
                 {$vo.car_type ?? ''}
              </span>
        </div>
      <div class="userinfo">
           <p>车座位：</p>
           <span>
                {$vo.seats ?? ''}
              </span>
       </div>
           <div class="userinfo">
           <p>车辆品牌：</p>
           <span>
                {$vo.car_brand ?? ''}
              </span>
       </div>
           <div class="userinfo">
               <p>汽车型号：</p>
               <span>
                {$vo.car_model ?? ''}
              </span>
           </div>
    </div>
       <div class="user">
      <div class="userinfo">
            <p>车牌号：</p>
            <span>
                 {$vo.plate_number ?? ''}
              </span>
        </div>
      <div class="userinfo">
            <p>行驶证有效期：</p>
            <span>
               {$vo.driving_permit_date ?? ''}
              </span>
        </div>
    </div>
       <div class="user">
      <div class="userinfo">
            <p>驾照号码：</p>
            <span>
                 {$vo.driver_license_number ?? ''}
              </span>
        </div>
      <div class="userinfo">
            <p>驾照有效期：</p>
            <span>
                 {$vo.driver_license_date ?? ''}
              </span>
        </div>
           <div class="userinfo">
               <p>汽车出厂日期：</p>
               <span>
                {$vo.car_product_date ?? ''}
              </span>
           </div>
    </div>
     <div class="imgBox">
       <div>
        <div class="imgs">
            <img width="100" height="100" src="{$vo['head_img']}"/>
           <p>头像</p>
        </div>
       </div>
       <div class="imgs">
            <img width="100" height="100" src="{$vo['car_front']}"/>
           <p>车前照</p>
        </div>
       <div class="imgs">
            <img width="100" height="100" src="{$vo['car_back']}"/>
           <p>车后照</p>
        </div>
       <div class="imgs">
            <img width="100" height="100" src="{$vo['in_car']}"/>
           <p>车内照</p>
        </div>
       <div class="imgs">
            <img width="100" height="100" src="{$vo['trunk_photo']}"/>
           <p>后备箱照片</p>
        </div>
       <div class="imgs">
            <img width="100" height="100" src="{$vo['driving_permit_img']}"/>
           <p>行驶证照片</p>
        </div>
       <div class="imgs">
            <img width="100" height="100" src="{$vo['insurance']}"/>
           <p>商业险照片</p>
        </div>
       <div class="imgs">
            <img width="100" height="100" src="{$vo['id_card_front_img']}"/>
           <p>身份证正面照</p>
        </div>
       <div class="imgs">
            <img width="100" height="100" src="{$vo['id_card_back_img']}"/>
           <p>身份证反面</p>
        </div>
       <div class="imgs">
            <img width="100" height="100" src="{$vo['take_id_card_img']}"/>
           <p>手持身份证照片</p>
        </div>

           <div class="imgs">
                <img width="100" height="100" src="{$vo['driver_license_img']}"/>
               <p>驾照照片</p>
            </div>
         {notempty name="vo['other_certificate']"}
           <div class="imgs">
                <img width="100" height="100" src="{$vo['other_certificate']}"/>
               <p>其他证件</p>
            </div>
         {/notempty}
         {notempty name="vo['other_certificate1']"}
       <div class="imgs">
            <img width="100" height="100" src="{$vo['other_certificate1']}"/>
           <p>其他证件照1</p>
        </div>
         {/notempty}
         {notempty name="vo['other_certificate2']"}
       <div class="imgs">
            <img width="100" height="100" src="{$vo['other_certificate2']}"/>
           <p>其他证件照2</p>
        </div>
         {/notempty}
     </div>
       

      
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="button" class="btn btn-primary radius" onclick="agree('/admin/driver/agree/user_id/{$vo.user_id}')">&nbsp;&nbsp;通过&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-primary radius" onclick="reject('/admin/driver/reject/user_id/{$vo.user_id}')" >&nbsp;&nbsp;不通过&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-primary radius" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="/static/admin/lib/Hui/jQuery.Huipreview.js"></script>
<script>
    function agree(url) {
        $.ajax({
            type: 'POST',
            url: url,
            data: null,
            success: function (re){
                if(re.msg){
                layer.msg(re.msg, {
                    time: 20000, //20s后自动关闭
                    btn: [ '知道了']
                },function () {
                    location.reload()
                });
                }else{
                layer_open('通过','/admin/pub/role/id/1')
                }
            },
        });
    }
    function reject(url) {
        $.ajax({
            type: 'POST',
            url: url,
            data: null,
            success: function (re){
                if(re.msg) {
                    layer.msg(re.msg, {
                        time: 20000, //20s后自动关闭
                        btn: ['知道了']
                    }, function () {
                        location.reload()
                    });
                }else{
                layer_open('不通过','/admin/pub/role/id/1')
                }
            },
        });
    }
    $(function () {
$(".imgs").Huipreview();
      
      
      
        upload_imgs("head_img");
        upload_imgs("car_front");
        upload_imgs("car_back");
        upload_imgs("in_car");
        upload_imgs("trunk_photo");
        upload_imgs("driving_permit_img");
        upload_imgs("insurance");
        upload_imgs("id_card_front_img");
        upload_imgs("id_card_back_img");
        upload_imgs("take_id_card_img");
        upload_imgs("driver_license_img");
        upload_imgs("other_certificate");
        upload_imgs("other_certificate1");
        upload_imgs("other_certificate2");


        $('#tag').tagsInput({width: 'auto', defaultText: "标签"});

        //用户select2 js部分 start
        var user_id = $("#user_id").select2({
            language: "zh-CN", //设置 提示语言
            width: "100%", //设置下拉框的宽度
            theme: "classic"
        });
        {notempty name = "vo['user_id']"}
        user_id.val("{$vo['user_id']}").trigger("change");
        {/notempty}
            //用户select2 js部分 end

            $("[name='leave_status'][value='{$vo.leave_status ?? '1'}']").attr("checked", true);
            $("[name='isagreee'][value='{$vo.isagreee ?? '1'}']").attr("checked", true);


            var remark = UE.getEditor('remark', {
                serverUrl: '{:\\think\\Url::build("Ueditor/index")}'
            });
    })
</script>
{/block}
